package cate.common.table.item.awakenfairy.sheet;

import cate.common.table.ESheet;
import cate.common.table.item.awakenfairy.row.AwakenFairyBaseRow;

import java.util.List;
import java.util.stream.Collectors;

public class AwakenFairyBaseSheet extends ESheet<AwakenFairyBaseRow> {
    @Override
    public String getSheetName() {
        return "灵器基础";
    }

    public AwakenFairyBaseRow getRow(int protoId, int level) {
        return getList().stream().filter(e -> e.protoId == protoId && e.level == level).findAny().orElse(null);
    }

    public List<AwakenFairyBaseRow> getLevelLowerRows(int protoId, int level) {
        return getList().stream().filter(e -> e.protoId == protoId && e.level <= level).collect(Collectors.toList());
    }
}
